Skip to content

[US-13.3 / OBT-244] Platform Overview: count pending change requests - #32

Open
levigtri wants to merge 2 commits into
levigft/obt-243-us-132-change-requests-admin-review-on-projects-languagesfrom
levigft/obt-244-us-133-platform-overview-count-pending-change-requests-in
Open

[US-13.3 / OBT-244] Platform Overview: count pending change requests#32
levigtri wants to merge 2 commits into
levigft/obt-243-us-132-change-requests-admin-review-on-projects-languagesfrom
levigft/obt-244-us-133-platform-overview-count-pending-change-requests-in

Conversation

@levigtri

Copy link
Copy Markdown
Member

[US-13.3 / OBT-244] Platform Overview: count pending change requests in the "Pending Requests" stat

Summary

The dashboard's Platform Overview "Pending Requests" stat counted only pending access requests. Change requests — create_project, create_language, edit_language (Area 13) — also await admin review but were invisible in the count. This makes the stat sum pending access requests + pending change requests, matching the card's own "Aggregate counts across the entire platform" framing. Both request fetches degrade gracefully, so a failure in one still renders the dashboard with what loaded.

Changes

1. Count both request types — src/components/pages/dashboard/AdminDashboard.tsx

  • Fetch pending change requests alongside the existing calls via changeRequestsAPI.list({ status: "pending" }) (no new endpoint).
  • AdminData gains pendingChangeRequests: ChangeRequestResponse[].
  • The "Pending Requests" StatCard value and highlight now use totalPending = pendingRequests.length + pendingChangeRequests.length.
  • Both the access-requests and change-requests fetches get a .catch(() => ({ data: [] })), so one failing endpoint no longer drops the whole dashboard — the overview renders and counts what it could load (stats are non-critical).

The existing "Pending Access Requests" detail panel is unchanged: it still lists access requests only (reviewed on the Users page); change requests are reviewed on the Projects/Languages pages.

Type of Change

  • Feature (Platform Overview now reflects pending change requests)

Testing

  • npm run typecheck (tsc -b) — pass
  • npm run lint (eslint .) — 0 errors
  • npm run build (vite build) — pass
  • Manual (on the local integration branch, logged in as platform admin): with N pending access requests and M pending change requests seeded, the "Pending Requests" card shows N + M and highlights when > 0; rejecting/approving a change request lowers the count on next dashboard load.

Stacked on US-13.2 / OBT-243 (PR #31). This branch depends on changeRequestsAPI / ChangeRequestResponse, which are introduced by #31 and are not yet on main. PR base is the obt-243 branch so the diff shows only this change. Merge order: #31 first, then this; rebase onto main once #31 lands.

levigtri and others added 2 commits July 10, 2026 00:13
The Platform Overview "Pending Requests" stat counted only pending
access requests. Add pending change requests (project/language create &
edit) so the card reflects everything awaiting admin review, matching
its "aggregate counts" framing. Both request fetches degrade gracefully
so a failure in one still renders the dashboard with what loaded.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: QUIET

Plan: Pro Plus

Run ID: dff53406-68f8-42eb-9536-a41a29a94d3c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch levigft/obt-244-us-133-platform-overview-count-pending-change-requests-in

Comment @coderabbitai help to get the list of available commands.

@levigtri levigtri self-assigned this Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant